#include "yolo.h"

using namespace cv;
int main()
{
    uint32_t g_modelWidth = 640;
    uint32_t g_modelHeight = 640;
    std::string imgname = "../VL.jpg";
    const char* g_modelPath = "../640_640_VL_best_3_sigmoid.om";
    

    yolo * detect = new yolo(g_modelPath, g_modelWidth, g_modelHeight);
    Result ret = detect->Init();

    // cv::Mat img = cv::imread(imgname, 1);
    cv::Mat img = cv::imread(imgname);
    vector<BBox> output;

    cv::Mat frame;
    
    cv::resize(img, frame, cv::Size(g_modelWidth, g_modelHeight));

    while(1)
    {
        ret = detect->Preprocess(frame.data);
        ret = detect->Inference();
        output = detect->Postprocess();
        detect->DrawBoundBoxToImage(output, img);
        output.clear();
    }
    

    ret = detect->UnInit();

    return 0;
}
